﻿using Grpc.Net.Client;
using Md.Demo.Rpc;
using Md.Demo.Service;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static Md.Demo.Service.Greeter;

namespace Md.Demo.API.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class GrpcTestController : ControllerBase
    {
        private readonly TestRpc _testRpc;
        public GrpcTestController(TestRpc testRpc)
        {
            _testRpc = testRpc;
        }

        [HttpGet]
        public async Task<IActionResult> TestSend()
        {
            var reply = await _testRpc.TestSend();
            return Ok(reply);
        }
    }
}
